<!doctype html>
<html ng-app="app">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../build/common/base.css" rel="stylesheet">
<script type="text/javascript" src="../../build/common/base.js"></script>
<script type="text/javascript" src="../../build/common/ngEdit.js"></script>
<script type="text/javascript" src="../../build/common/uedtor.js"></script>
</head>
<script type="text/javascript">
	var app = angular.module('app', [ 'baseDirective' ]);
	var id = $.getParam("id");
	var time = new Date();
	app.controller("ctrl", [ '$scope', 'baseService',
			function($scope, baseService) {
				$scope.Date = new Date().format("yyyy-MM-dd HH:mm:ss");
			} ]);

	/* 获取URL表单的 JSON 数据  必须以 getData为方法名*/
	function getData() {
		return AngularUtil.getScope().data;
	}
	/* 获取URL表单的校验情况，必须以isValid 为方法名 */
	function isValid() {
		//校验表单 ab-validate的 校验
		if (!ngUtil.getScope().form.$valid) {
			$.Dialog.error("表单校验不通过！");
			return false;
		}

		return true;
	}
</script>
<body class="panel success" ng-controller="ctrl">
	<!-- 顶部按钮 -->
	<div class="panel-heading">
		<a class="btn btn-primary fa-save" ng-model="data" use-default-after-save-event="true"
			ab-save="/crm/notice/save"> 保存 </a> <a href="javascript:void(0)"
			class="btn btn-sm btn-primary fa-reply"
			onclick="javascript:$.Dialog.close(window);"> 返回 </a>
	</div>
	<!--  ab-load 去controller 层获取业务数据  -->
	<form name="form" method="post" ab-load="crm/notice/get?id={id}"
		ng-model="data">


		<table class="form-table">
			<tbody>
				<tr class="firstRow">
					<th>标题</th>
					<td><input type="text" class=" form-control"
						ng-model="data.title"
						desc="标题"
						ab-validate="{}" /></td>
				</tr>
				<tr>								
					<th>发布时间</th>
					<td><input ng-init="data.releaseTime=Date" class=" form-control" ng-model="data.releaseTime" ab-validate="{}" desc="发布时间" ab-date="yyyy-MM-dd HH:mm:ss"/></td>								
				</tr>
				<tr>
					<th>附件</th>
					<td><a href="javascript:void(0)"
						class=" btn btn-primary fa-upload" ab-upload=""
						ng-model="data.attachment"
						></a></td>
				</tr>
				<tr>
					<td colspan="2">
						<textarea ab-editor config="editorConfig" ng-model="data.content"></textarea>
					</td>
				</tr>
				
				
			</tbody>
		</table>


	</form>

</body>















</html>